package boot.dao;

import boot.domain.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author enthalpy
 * @since 2022-10-28
 */
@Mapper
public interface SupplierDao extends BaseMapper<Supplier> {

    // 查询商品的供应商
    @Select("SELECT product.* from product, product_supplier where product_supplier.product_id = #{id}")
    List<Supplier> getSuppliersById(int id);
}
